﻿using System.Windows;

namespace UltimateNavigationFramework.Commands
{
    public class NavigateCommandBehaviorBase : CommandBehaviourBase<UIElement>
    {
        #region Additional Navigation Properties
        public string NavigateUri { get; set; }
        public string FormatA { get; set; }
        public string FormatB { get; set; }
        public string FormatC { get; set; } 
        #endregion

        public NavigateCommandBehaviorBase(UIElement obj)
            : base(obj)
        {
            if (obj == null) 
                throw new System.ArgumentNullException("obj");
        }

        protected override void ExecuteCommand()
        {            
            if (this.Command != null)
            {
                this.Command.Execute(new NavigationObject(this.CommandParameter, this.NavigateUri, this.FormatA, this.FormatB, this.FormatC));
            }
        }
    }
}
